package com.stu.entity.service;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.stu.entity.base.BaseEntity;
import com.stu.entity.permission.PermissionUser;

@Entity
@Table(name = "CODELIBRARY")
public class CodeLibrary extends BaseEntity{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private String content;
	private String msg;//代码一些注意事项之类
	private PermissionUser user;
	private int permissionCode;//需要几级权限才可以查看
	
	@Column(name = "content", length = 1000)
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	@Column(name = "msg", length = 500)
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user")
	public PermissionUser getUser() {
		return user;
	}
	public void setUser(PermissionUser user) {
		this.user = user;
	}
	@Column(name = "permissionCode")
	public int getPermissionCode() {
		return permissionCode;
	}
	public void setPermissionCode(int permissionCode) {
		this.permissionCode = permissionCode;
	}
	public CodeLibrary() {
		super();
	}
	public CodeLibrary(String uuid) {
		super(uuid);
	}
	@Override
	public String toString() {
		return "CodeLibrary [content=" + content + ", msg=" + msg + ", user=" + user + ", permissionCode="
				+ permissionCode + "]";
	}
	
}
